﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using OpenSocialPlugin.General;

namespace OpenSocialPlugin
{
    public partial class GeneralSetting : UserControl,ISettingForm
    {
        public Settings _setting = new Settings();
        public GeneralSetting()
        {
            InitializeComponent();
        }

        private void GeneralSetting_Load(object sender, EventArgs e)
        {
          _setting.Load();
          textBox_pluginname.Text = _setting.PluginName;
          textBox_downloadfolder.Text = _setting.PictureDownloadFolder;
        }



      #region ISettingForm Members

        public void Save()
        {
          _setting.PluginName = textBox_pluginname.Text;
          _setting.PictureDownloadFolder = textBox_downloadfolder.Text;
          _setting.Save();
        }

      #endregion

        private void button1_Click(object sender, EventArgs e)
        {
          folderBrowserDialog1.SelectedPath = textBox_downloadfolder.Text;
          if(folderBrowserDialog1.ShowDialog()==DialogResult.OK)
          {
            textBox_downloadfolder.Text = folderBrowserDialog1.SelectedPath;
          }
        }
    }
}
